import 'package:flutter_shop/pages/common/login/entity/user_info.dart';

userInfoFromJson(UserInfo data, Map<String, dynamic> json) {
	if (json['userId'] != null) {
		data.userId = json['userId']?.toString();
	}
	if (json['username'] != null) {
		data.username = json['username']?.toString();
	}
	if (json['realname'] != null) {
		data.realname = json['realname']?.toString();
	}
	if (json['password'] != null) {
		data.password = json['password']?.toString();
	}
	if (json['headPic'] != null) {
		data.headPic = json['headPic']?.toString();
	}
	if (json['phone'] != null) {
		data.phone = json['phone']?.toString();
	}
	if (json['address'] != null) {
		data.address = json['address']?.toString();
	}
	if (json['token'] != null) {
		data.token = json['token']?.toString();
	}
	if (json['deptId'] != null) {
		data.deptId = json['deptId']?.toString();
	}
	if (json['deptName'] != null) {
		data.deptName = json['deptName']?.toString();
	}
	if (json['friendId'] != null) {
		data.friendId = json['friendId']?.toString();
	}
	if (json['friendName'] != null) {
		data.friendName = json['friendName']?.toString();
	}
	return data;
}

Map<String, dynamic> userInfoToJson(UserInfo entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['userId'] = entity.userId;
	data['username'] = entity.username;
	data['realname'] = entity.realname;
	data['password'] = entity.password;
	data['headPic'] = entity.headPic;
	data['phone'] = entity.phone;
	data['address'] = entity.address;
	data['token'] = entity.token;
	data['deptId'] = entity.deptId;
	data['deptName'] = entity.deptName;
	data['friendId'] = entity.friendId;
	data['friendName'] = entity.friendName;
	return data;
}